package study.stream.生成无限流;

import java.util.ArrayList;
import java.util.stream.Stream;

/**
 * @Author 金贵权
 * @Date 2023/6/16 16:40
 **/
public class Demo01 {
    public static void main(String[] args) {
        Stream.iterate(0,n->n+2).limit(10).forEach(System.out::println);
        Stream.iterate(new int[]{0,1},n->new int[]{n[1],n[0]+n[1]}).limit(20).forEach(t-> System.out.println("t[0]的值为"+t[0]+",t[1]的值为"+t[1]));
    }
}
